package com.zfast.yugioh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zfast.forge.common.BaseService;
import com.zfast.forge.common.Page;
import com.zfast.yugioh.model.Role;
import com.zfast.yugioh.mapper.RoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 角色
 *
 * @author zgn
 * @email 
 * @date 2022-06-11 15:07:43
 */
@Service("roleService")
public class RoleService extends BaseService<Integer, Role> {
    public RoleService(RoleMapper mapper) {
        super(mapper);
    }

    @Resource
    RoleMapper roleMapper;

    public PageInfo<Role> pageList(Page<Role> page) {
        PageHelper.startPage(page.getNum(), page.getSize());
        List<Role> list = roleMapper.selectLikeRole(page.getData());
        PageInfo<Role> pageInfo = new PageInfo(list);
        return pageInfo;
    }
}

